package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EmployeeScheduleMapper;
import com.ruoyi.system.domain.EmployeeSchedule;
import com.ruoyi.system.service.IEmployeeScheduleService;

/**
 * 员工排班Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-12
 */
@Service
public class EmployeeScheduleServiceImpl implements IEmployeeScheduleService
{
    @Autowired
    private EmployeeScheduleMapper employeeScheduleMapper;

    /**
     * 查询员工排班
     *
     * @param id 员工排班主键
     * @return 员工排班
     */
    @Override
    public EmployeeSchedule selectEmployeeScheduleById(Long id)
    {
        return employeeScheduleMapper.selectEmployeeScheduleById(id);
    }

    /**
     * 查询员工排班列表
     *
     * @param teamName 班组名称
     * @return 员工排班
     */
    @Override
    public List<EmployeeSchedule> selectEmployeeScheduleListByName(String teamName)
    {
        return employeeScheduleMapper.selectEmployeeScheduleListByName(teamName);
    }

    /**
     * 新增员工排班
     *
     * @param employeeSchedule 员工排班
     * @return 结果
     */
    @Override
    public int insertEmployeeSchedule(EmployeeSchedule employeeSchedule)
    {
        return employeeScheduleMapper.insertEmployeeSchedule(employeeSchedule);
    }

    /**
     * 修改员工排班
     *
     * @param employeeSchedule 员工排班
     * @return 结果
     */
    @Override
    public int updateEmployeeSchedule(EmployeeSchedule employeeSchedule)
    {
        return employeeScheduleMapper.updateEmployeeSchedule(employeeSchedule);
    }

    /**
     * 批量删除员工排班
     *
     * @param ids 需要删除的员工排班主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeScheduleByIds(Long[] ids)
    {
        return employeeScheduleMapper.deleteEmployeeScheduleByIds(ids);
    }

    /**
     * 删除员工排班信息
     *
     * @param id 员工排班主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeScheduleById(Long id)
    {
        return employeeScheduleMapper.deleteEmployeeScheduleById(id);
    }
}
